# 处理批量数据
while True:
    try:
        n,m=map(int,input().split())
        a=list(map(int,input().split()))
        # 处理差分数组
        diff=[0]*(n+1)
        diff[0]=a[0]
        for i in range(1,n):
            diff[i]=a[i]-a[i-1]
        # 进行m次操作，每次对区间[x,y]加上z
        for _ in range(m):
            x,y,z=map(int,input().split())
            x-=1
            y-=1
            diff[x]+=z
            diff[y]-=z
        # 将差分数组还原为原数组
        a[0]=diff[0]
        for i in range(1,n):
            a[i]=a[i-1]+diff[i]
        print(''.join(map(str,a)))

    except:
        break
